Effective inventory control for coffee-vending machines hinges on anticipating weekly ingredient consumption while avoiding costly spoilage. We forecast demand using historical sales from two machines, delivering eight-week projections that guide stock levels and reorder cadence.
This report:
Imports & cleans transaction data from two coffee-vending machines.
Explores key demand drivers.
Models weekly sales with Seasonal ARIMA (plus Prophet as a benchmark).
Delivers eight-week forecasts and stocking recommendations.
Data Input and Combining
Kaggle data is from two vending machines. Below we will import the two datasets and combine them.
Raw Transaction Data
Transaction data was taken from the following Kaggle link:
In the dataset, only product names are given. In order to more accurately predict what ingredients are needed and when, we must decompose the product into its ingredients. See below for the assumptions made for each of the 33 unique products.
Below we will join the two tables on the coffee name, which will add ingredients to all rows in the transaction data. Explore the data we will use in our analysis below:
We aggregate to a weekly time series because the business decisions we are informing, like re-ordering coffee, milk, chocolate, etc, are made on a weekly cadence. Collapsing daily transactions into weeks smooths out erratic, day-to-day swings leaving a cleaner signal that aligns directly with the quantity we must predict.
We will also convert to a time series type object and verify it has no gaps in the series. If we see FALSE from .gaps, then we have no gaps.